<template>
  <BasicModal v-bind="$attrs" @register="registerModal" title="查看Secret" @ok="handleSubmit" width="600px">
    <Description @register="registerDescription" :data="detailData" />
  </BasicModal>
</template>
<script lang="ts" setup>
import {ref, useAttrs} from 'vue';
import {BasicModal, useModalInner} from '/@/components/Modal';
import {Description, useDescription} from '/@/components/Description/index';
import {secretFormDetailSchema} from './accessKey.data';

const emit = defineEmits(['register', 'close']);
  const attrs = useAttrs();
  const detailData = ref({});
  const [registerDescription] = useDescription({
    bordered: false,
    // data: mockData,
    schema: secretFormDetailSchema,
    labelStyle: {
      marginLeft: '60px'
    }
  });

  const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
    setModalProps({ confirmLoading: false });
    detailData.value = data;
  });

  const handleSubmit = () => {
    closeModal()
    emit('close')
  }
</script>
